home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / New System Software Extensions / MacODBC SDK 2.0b1 / ODBC Tools / Mac ODBC 2.0 Developer Info next >
Encoding:
Text File  |  1995-06-13  |  10.5 KB  |  250 lines  |  [TEXT/ttxt]

  1.  
  2.  
  3. Compile Time Defines
  4. ====================
  5.  
  6. MACODBC    
  7. The MACODBC define is used in the C Include files to indicate the Macintosh environment.  Used in SQL.H, SQLEXT.H,     ODBCINST.H.
  8.                 
  9. ODBCVERS    
  10. Used within the header files to know what version of the ODBC interface is being used.  By default it is set to 0x210.
  11.  
  12. PPCODBC
  13. Used within the sample application and libraries to know if the target is for the 680x0 or the PowerMac.  This define is not used within the actual ODBC C Include files.
  14.  
  15.  
  16. C Include files
  17. =============
  18.  
  19. DataTran.h    
  20. File contains the prototypes and definitions for the Data Translation library interface.
  21.                 
  22. DBCS.H    
  23. File is not currently used on the Macintosh.
  24.  
  25. ODBCASLM.h    
  26. File contains the ASLM specific definitions needed by a 680x0 ODBC application or library.
  27.                 
  28. ODBCINST.H    
  29. File contains the prototypes and definitions for the Configuration Manager interface and the Driver Setup library.
  30.                 
  31. ODBCVER.H    
  32. File is not currently used on the Macintosh.
  33.  
  34. SQL.H    
  35. File contains the ODBC core level API prototypes and definitions.
  36.  
  37. SQLEXT.H    
  38. File contains the ODBC level 1 and level 2 API prototypes and definitions.
  39.  
  40. win2mac.h    
  41. File contains a set of Macintosh specific definitions.  It is used in the SQL.H, and ODBCINST.H include files.
  42.  
  43.  
  44. Resource Files
  45. =============
  46.  
  47. ODBCtypes.r    
  48. File contains the ODBC resource definitions for the PowerMac.
  49.  
  50. CodeFragmentTypes.r    
  51. File contains the extended definition of the PowerMac 'cfrg' resource as defined by Apple.   The PowerMac ODBC Driver Manager and Configuration Manager are using the "search" fields of the extended 'cfrg' resource to be able to find all ODBC libraries of a given type.  The "International Name" field is used as the name that should be presented to the User and is also used to make the association between the driver library and the setup library (i.e. the "International Name" for the driver and setup libraries must match.)
  52.                             
  53.  
  54.  
  55. Import Library files
  56. ==================
  57.  
  58. ODBCConfigMgr.cl.o    
  59. Configuration Manager Far Model Import library for 680x0/ASLM.
  60.  
  61. ODBCConfigMgr.cln.o    
  62. Configuration Manager Near Model Import library for 680x0/ASLM.
  63.  
  64. ODBCDriverMgr.cl.o    
  65. Driver Manager Far Model Import library for 680x0/ASLM.
  66.  
  67. ODBCDriverMgr.cln.o    
  68. Driver Manager Near Model Import library for 680x0/ASLM.
  69.  
  70. ODBCConfigMgr.xcoff    
  71. Configuration Manager Import Library for PowerMac/CFM.
  72.  
  73. ODBCDriverMgr.xcoff    
  74. Driver Manager Import Library for PowerMac/CFM.
  75.  
  76.  
  77. Run Time files
  78. =============
  79.  
  80. ODBC Setup    
  81. This is the ODBC control panel for 680X0/ASLM.
  82.  
  83. ODBC Driver Manager    
  84. ODBC Driver Manager for 680X0/ASLM.
  85.  
  86. ODBC Configuration Manager    
  87. ODBC Configuration Manager of 680X0/ASLM.
  88.  
  89. ODBC Cursor Library    
  90. ODBC Cursor Library for 680X0/ASLM.
  91.  
  92. ODBC Setup PPC    
  93. This is the ODBC control panel for PowerMac/CFM.
  94.  
  95. ODBC Driver Manager PPC    
  96. ODBC Driver Manager for PowerMac/CFM.
  97.  
  98. ODBC Configuration Manager PPC    
  99. ODBC Configuration Manager of PowerMac/CFM.
  100.  
  101. ODBC Cursor Library PPC    
  102. ODBC Cursor Library for PowerMac/CFM.
  103.  
  104.  
  105. Building an Application
  106. =====================
  107.  
  108. Building an ODBC application on the Macintosh is just as easy as it is on 
  109. Windows.  You include the ODBC header files (SQL.H, SQLEXT.H, etc.), define the MACODBC flag,  and link with the appropriate link files as detailed above.
  110.  
  111. For the 680x0/ASLM environment the application is responsible for initializing and
  112. cleaning up the ASLM Shared Library Manager by calling InitLibraryManager and
  113. CleanupLibraryManager routines.  These are the only non-ODBC calls that are
  114. required for a Macintosh application to utilize the ODBC architecture.
  115.  
  116.  
  117. ODBC APPLICATION NOTES:
  118. =======================
  119.  
  120. There is no interoperability between the 68k and the PowerMac architecture.
  121.  
  122. If you want your application to be able to access 68k libraries on the PowerMac, it is not possible to build a "fat" ODBC application. 
  123.  
  124. Reason:  The MacOS must run your application in 68k mode in order to access 68k libraries.
  125.  
  126.  
  127. Building an ODBC library
  128. ======================
  129.  
  130. ASLM/680X0 libraries
  131. --------------------
  132.  
  133. The mechanisms for building and supporting ODBC libraries in the 680X0/ASLM
  134. environment has not changed from those used in ODBC for Macintosh 1.0.
  135.  
  136. The version of ASLM that is currently incorporated into the ODBC 2.0 SDK is
  137. ASLM version 1.1.2.
  138.  
  139. To build a 680X0 ODBC library the ASLM developer tools need to be installed into your MPW environment.  Verify that this has been done by building one of the ASLM examples.
  140.  
  141. The ASLM developer tools are not shipped as part of this product.  They are available from Apple in various packages including ETO, ...
  142.  
  143.  
  144. CFM/PowerMac libraries
  145. ----------------------
  146.  
  147. The native ODBC architecture for the PowerMac is based around the 
  148. Code Fragment Manager.  The Code Fragment Manager provides similar facilities
  149. to those provided by ASLM, and since it is a native facility of the MacOS
  150. on the PowerMac it is better integrated and better supported by all of the 
  151. standard development tools.  The one facility that ASLM provided that was not 
  152. provided by CFM in it's current implementation was the ability to group and 
  153. search for groups of libraries.  This facility will be provided in the next 
  154. release of the Code Fragment Manager and is currently in beta.  The new search 
  155. facility will be utilized by CFM and many of it's clients (SOM, Component Manager,
  156. Open Doc and others).  We wanted to be compatible with this upcoming 
  157. architecture so utilized the extended 'cfrg' resource as defined by Apple 
  158. and we implemented our own search routines for now.
  159.  
  160. The definition for the extended 'cfrg' resource is in ":INCLUDE:CodeFragmentTypes.r".
  161.  
  162. There are 4 fields of the 'cfrg' resource that are utilized by the ODBC Driver
  163. Manager and/or the Configuration Manager.
  164.  
  165. Member Name field
  166. -----------------
  167.  
  168. The "member name" field of the 'cfrg' resource, which is essentially the 
  169. library name, is used by the Driver Manager to load a driver.  
  170. The member name is saved in the ODBC Preferences file as follows:
  171.  
  172. [DATA SOURCE SECTION]
  173. driver=<member name>
  174. ...
  175.  
  176. The member name must be unique.  In our samples we have used a naming 
  177. convention that is much like the naming convention for function sets in
  178. ASLM. Example:  vsi:ODBC$SampleDriver.  This is just an example and there 
  179. is no requirement for driver's to use this naming convention.  The only
  180. thing that is required is that the member name be unique within the CFM search
  181. path.
  182.  
  183. Qualifier 1 Search field.
  184. ---------------------
  185.  
  186. The qualifier 1 search field of the extended 'cfrg' resource is used to define the ODBC library type.  There are 4 ODBC library types that are defined in ODBCtypes.r and they are:
  187.  
  188. #define kODBCSystemLibTypeID    "ODBC Shared Library: System"
  189. #define kODBCDriverLibTypeID    "ODBC Shared Library: Driver"
  190. #define kODBCSetupLibTypeID     "ODBC Shared Library: Setup"
  191. #define kODBCTranslateLibTypeID "ODBC Shared Library: Translate"
  192.  
  193. These strings and the qualifier 1 field are used by the Configuration Manager to search for all libraries of a given type.  A driver writer should utilize the appropriate define in the definition of their 'cfrg' resource when building an ODBC library.
  194.  
  195. Qualifier 2 Search field.
  196. ----------------------
  197.  
  198. The Qualifier 2 search field replicates the member name field.  This field is currently not used by the ODBC architecture, but may be in the future.  We wanted to be able to get an exact match from the CFM search facilities for any given ODBC library.  Since we currently save the "member name" in the Prefs file, this would allow us to be upwards compatible with the new CFM search facilities when they are available.
  199.  
  200. International Name field (intlName)
  201. --------------------------------
  202.  
  203. The International Name field is used by the Configuration Manager in 2 ways:
  204. 1) It is the name for a library that is presented to the user.
  205. 2) It is used to associate a driver library with a setup library.  This means that this field must be an exact match in the driver library and the associated setup library.
  206.  
  207.  
  208. ODBC LIBRARY NOTES:
  209. -------------------
  210.  
  211. If you want your library to be able to run in 68k mode on the PowerMac, it is not possible to build a "fat"  ODBC library.  
  212. Reason:  It is necessary to have different file types and creators for the library (i.e. one for ASLM, one for CFM).
  213.  
  214. If you want to build a 1.0 driver with the 2.0 SDK, the ODBCVER define needs to be set.
  215. Example:
  216. #define ODBCVER 0x100
  217.  
  218. Currently all PowerMac ODBC libraries need to be in the Extensions folder.
  219.  
  220. A new 'odbc' resource id=1 has been added to a driver libraries resource file to support the SQLdriver API call szDriverAttributes parameter.  This information in the Windows environment is in the ODBCINST.INI file.  On the Macintosh there is no equivalent to this file.  See the API Reference and the Sample Driver source for more details.
  221.  
  222. ODBC Installation
  223. ================
  224.  
  225. The installation of the ODBC components is relatively straight forward.  We provide both 680X0/ASLM and PowerMac/CFM based components.  
  226.  
  227. 680x0 Environment
  228. -----------------
  229.  
  230. In the 680X0 environment we install just the 680X0 components.  The ASLM libraries (ODBC Driver Manager, ODBC Configuration Manager, and ODBC Cursor Library) are installed in the Extensions folder.  The ODBC Setup Control Panel is installed into the Control Panel folder inside the System Folder.  The ODBC Preferences file is created on first configuration and is created in the Preferences folder inside the System Folder. 
  231.  
  232. PowerMac Environment
  233. ---------------------
  234.  
  235. In the PowerMac environment we install the PowerMac components as well as the 680x0 components listed above.  The CFM libraries ("ODBC Driver Manager PPC", "ODBC Configuration Manager PPC", and "ODBC Cursor Library PPC") are installed in the Extensions folder.  The "ODBC Setup PPC" Control Panel is installed into the Control Panel folder inside the System Folder.  The "ODBC Preferences PPC" file is created on first configuration and is created in the Preferences folder inside the System Folder. 
  236.  
  237. ASLM Installation
  238. ----------------
  239.  
  240. The ASLM installation is done in both the 680X0 and PowerMac environments.  We are licensing the ASLM installation script from Apple.  At present I do not know all of the details of what the ASLM installation script is doing.  We have modified it just enough to make it run from our disks.  What I know is that the "Apple Shared Library Manager" is placed in the Extensions folder and a set of "system hooks" are rez'ed into the System File.
  241.  
  242. ODBC INSTALLATION NOTES:
  243. ------------------------
  244.  
  245. Due to the installation of ASLM and it's changes to the System file, the Macintosh needs to be restarted after the installation.
  246.  
  247. The version of ASLM that is currently incorporated into the ODBC 2.0 SDK is
  248. ASLM version 1.1.2.
  249.  
  250.